Skip to content

editor: Fixed the extra dockable when adding a tab#8

Merged
hexaredecimal merged 1 commit intomainfrom
dockable
May 15, 2025
Merged

editor: Fixed the extra dockable when adding a tab#8
hexaredecimal merged 1 commit intomainfrom
dockable

Conversation

@hexaredecimal
Copy link
Copy Markdown
Collaborator

@hexaredecimal hexaredecimal commented May 15, 2025

Fixed a minor bug that was happening when adding a new tab. An extra dockable was getting added for every tab that is created. This is because vldocking expects us to add our dockables to the contentPane before managing them.

Summary by CodeRabbit

  • Refactor
    • Updated the way the first editor tab is displayed in the main window for improved integration with the application interface. Subsequent tabs are added as before. No visible changes to controls or features.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 15, 2025

Walkthrough

The update changes how the first editor tab is added in the main window. Instead of adding the first editor to the docking desktop, it is now placed directly into the JFrame's content pane. The logic for adding subsequent tabs remains unchanged, and no public method signatures were altered.

Changes

File Change Summary
src/main/java/org/editor/EditorWindow.java Modified logic to add the first editor tab directly to the JFrame's content pane instead of the docking desktop; no changes to public method signatures.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EditorWindow
    participant JFrame
    participant DockingDesktop

    User->>EditorWindow: addTab(editor)
    alt First tab
        EditorWindow->>JFrame: add(editor)
    else Subsequent tabs
        EditorWindow->>DockingDesktop: addDockable(editor)
    end
Loading

Poem

In the editor’s gentle light,
The first tab finds a brand new site—
No longer docked, it takes the stage,
Right in the frame, a fresh new page.
Tabs that follow, dock as before,
While bunnies hop and editors soar!
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6716381 and 5dc0e03.

📒 Files selected for processing (1)
  • src/main/java/org/editor/EditorWindow.java (2 hunks)
🔇 Additional comments (2)
src/main/java/org/editor/EditorWindow.java (2)

238-241: Fix for dockable issue looks good

The change from win.desk.addDockable(editor) to win.getContentPane().add(editor) for the first editor tab correctly addresses the root cause described in the PR objective. By adding the dockable to the content pane before it's managed by createTab(), you're following the vldocking library's expected workflow.

This should effectively fix the issue of extra dockables being created when adding tabs.


257-260: Consistent implementation of the fix across both addTab methods

Good work on consistently applying the same fix to both overloaded addTab methods. This change ensures the correct behavior whether adding an empty tab or opening a file.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hexaredecimal hexaredecimal merged commit a4d09c0 into main May 15, 2025
2 checks passed
@hexaredecimal hexaredecimal mentioned this pull request May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant